package com.ly.heart.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ly.common.utils.DateUtils;
import com.ly.common.utils.erp.SnowflakeIdWorker;
import com.ly.heart.domain.ActGroupEntity;
import org.springframework.stereotype.Service;
import com.ly.heart.mapper.ActGroupMapper;
import com.ly.heart.service.IActGroupService;

import javax.annotation.Resource;

/**
 * 流程模型分组Service业务层处理
 *
 * @author cxl
 * @date 2024-05-25
 */
@Service
public class ActGroupServiceImpl extends ServiceImpl<ActGroupMapper, ActGroupEntity> implements IActGroupService
{
    @Resource
    private ActGroupMapper actGroupMapper;

    /**
     * 查询流程模型分组
     *
     * @param id 流程模型分组ID
     * @return 流程模型分组
     */
    @Override
    public ActGroupEntity selectActGroupById(String id)
    {
        return actGroupMapper.selectActGroupById(id);
    }

    /**
     * 查询流程模型分组列表
     *
     * @param actGroup 流程模型分组
     * @return 流程模型分组
     */
    @Override
    public List<ActGroupEntity> selectActGroupList(ActGroupEntity actGroup)
    {
        return actGroupMapper.selectActGroupList(actGroup);
    }

    /**
     * 新增流程模型分组
     *
     * @param actGroup 流程模型分组
     * @return 结果
     */
    @Override
    public int insertActGroup(ActGroupEntity actGroup)
    {
        actGroup.setId(SnowflakeIdWorker.getInstance().nextStringId());
        actGroup.setCreateTime(DateUtils.getNowDate());
        return actGroupMapper.insertActGroup(actGroup);
    }

    /**
     * 修改流程模型分组
     *
     * @param actGroup 流程模型分组
     * @return 结果
     */
    @Override
    public int updateActGroup(ActGroupEntity actGroup)
    {
        actGroup.setChangeTime(DateUtils.getNowDate());
        return actGroupMapper.updateActGroup(actGroup);
    }

    /**
     * 批量删除流程模型分组
     *
     * @param ids 需要删除的流程模型分组ID
     * @return 结果
     */
    @Override
    public int deleteActGroupByIds(String[] ids)
    {
        return actGroupMapper.deleteActGroupByIds(ids);
    }

    /**
     * 删除流程模型分组信息
     *
     * @param id 流程模型分组ID
     * @return 结果
     */
    @Override
    public int deleteActGroupById(String id)
    {
        return actGroupMapper.deleteActGroupById(id);
    }
}
